<script src="<?= base_url(); ?>third_party/ckeditor/ckeditor.js"></script>

<div class="clear"> </div>
<div class="box_2">
    <div class="title reg bold"> 
        <span class="inline-block align_left fleft" style="width: 590px"><h3 class="color_2"> Write Review </h3></span> 
        <span class="color_3"><a href="javascript:history.back()">Go Back</a></span>
        <div class="clear"></div>
    </div>

    <div class="clear"> </div>


    <form id="post_review" method="post" action="<?= base_url(); ?>review/review_submit">
        <div id="inner">
            <?php if ($this->session->flashdata('message')) { ?>
                <div id="message"> <?= $this->session->flashdata('message'); ?></div>
            <?php } ?>
            <!-- End of Message -->
            <div class="clear"> </div>
            <div class="fleft" style="width: 300px; border-right: dotted 1px #d6dff7">
                <div class="rowElem">
                    <div class="fleft">
                        <label><strong>Make:</strong></label>
                        <?= form_error('car_make', '<div class="error">', '</div>'); ?>
                        <select name="car_make" onChange="getCarModel(this.value,'<?= base_url(); ?>','modeldiv');">
                            <option value="" selected>Select Make</option>
                            <?php foreach ($make['info'] as $car_make): ?> 
                                <option value="<?= $car_make->id; ?>"><?= $car_make->make; ?></option>
                            <?php endforeach; ?>
                        </select>
                    </div>
                </div>
                <div class="rowElem">
                    <div class="fleft">
                        <label><strong>Model:</strong></label>
                        <?= form_error('car_model', '<div class="error">', '</div>'); ?>
                        <div id="modeldiv">
                            <select name="car_model" onChange="getCarVersion(this.value,'<?= base_url(); ?>');">>
                                <option value="" selected="selected">Model</option>
                                <option value="" disabled="disabled">----------------</option>
                            </select>  
                        </div>

                    </div>
                </div>
                <div class="clear"></div>

                <div class="rowElem">
                    <div class="fleft">
                        <label><strong>Version:</strong></label>
                        <?= form_error('car_version', '<div class="error">', '</div>'); ?>
                        <div id="ver_div">
                            <select name="car_version" >
                                <option value="" selected>Any Make</option>
                            </select>
                        </div>
                    </div>
                </div>
                <div class="clear"></div>

                <div class="rowElem">
                    <div class="fleft">
                        <label><strong>Exterior & Style:</strong></label>
                        <?= form_error('exterior', '<div class="error">', '</div>'); ?>
                        <select name="exterior">
                            <option value="<?= set_value('exterior'); ?>" selected="selected"><?= $this->pickup_model->get_pickup_info(14, set_value('exterior'))->description; ?></option>
                            <option value="" disabled="disabled">-</option>
                            <?php foreach ($pickup['ratting'] as $ratting): ?> 
                                <option value="<?= $ratting->slno; ?>"><?= $ratting->description; ?></option>
                            <?php endforeach; ?>

                        </select>  
                    </div>
                </div>

                <div class="rowElem">
                    <div class="fleft">
                        <label><strong>Comfort & Space:</strong></label>
                        <?= form_error('comfort', '<div class="error">', '</div>'); ?>
                        <select name="comfort">
                            <option value="<?= set_value('comfort'); ?>" selected="selected"><?= $this->pickup_model->get_pickup_info(14, set_value('comfort'))->description; ?></option>
                            <option value="" disabled="disabled">-</option>
                            <?php foreach ($pickup['ratting'] as $ratting): ?> 
                                <option value="<?= $ratting->slno; ?>"><?= $ratting->description; ?></option>
                            <?php endforeach; ?>
                        </select>  
                    </div>
                </div>

                <div class="rowElem">
                    <div class="fleft">
                        <label><strong>Performance:</strong></label>
                        <?= form_error('performance', '<div class="error">', '</div>'); ?>
                        <select name="performance">
                            <option value="<?= set_value('performance'); ?>" selected="selected"><?= $this->pickup_model->get_pickup_info(14, set_value('performance'))->description; ?></option>
                            <option value="" disabled="disabled">-</option>
                            <?php foreach ($pickup['ratting'] as $ratting): ?> 
                                <option value="<?= $ratting->slno; ?>"><?= $ratting->description; ?></option>
                            <?php endforeach; ?>
                        </select>
                    </div>
                </div>

                <div class="rowElem">
                    <div class="fleft">
                        <label><strong>Fuel Economy (mileage):</strong></label>
                        <?= form_error('fuel', '<div class="error">', '</div>'); ?>
                        <select name="fuel">
                            <option value="<?= set_value('fuel'); ?>" selected="selected"><?= $this->pickup_model->get_pickup_info(14, set_value('fuel'))->description; ?></option>
                            <option value="" disabled="disabled">-</option>
                            <?php foreach ($pickup['ratting'] as $ratting): ?> 
                                <option value="<?= $ratting->slno; ?>"><?= $ratting->description; ?></option>
                            <?php endforeach; ?>
                        </select> 
                    </div>
                </div>

                <div class="rowElem">
                    <div class="fleft">
                        <label><strong>Value for Money & Features:</strong></label>
                        <?= form_error('value', '<div class="error">', '</div>'); ?>
                        <select name="value">
                            <option value="<?= set_value('value'); ?>" selected="selected"><?= $this->pickup_model->get_pickup_info(14, set_value('value'))->description; ?></option>
                            <option value="" disabled="disabled">-</option>
                            <?php foreach ($pickup['ratting'] as $ratting): ?> 
                                <option value="<?= $ratting->slno; ?>"><?= $ratting->description; ?></option>
                            <?php endforeach; ?>
                        </select> 
                    </div>
                </div>

                <div class="clear"></div>

            </div>


            <div class="fright" style="width: 300px">
                <div class="marg_bottom_1"><h2>Reviews Guidelines</h2> </div>
                <ul class="color_2">
                    <li class="marg_bottom_line li-bullet">Be objective and truthful. Tell us how you really feel. 
                        The useful reviews include not only whether you liked or disliked Vehicle, 
                        but also why. Feel free to mention related items and how this car rates in 
                        comparison to them. Be detailed and specific: </li>

                    <li class="marg_bottom_line li-bullet">Did the car meet your expectations? </li>
                    <li class="marg_bottom_line li-bullet">How does the car compare to other, similar cars in the marketplace with which you have experience?</li>
                    <li class="marg_bottom_line li-bullet">What features of the car do you like or dislike? </li>
                    <li class="marg_bottom_line li-bullet">Would you recommend the car to others?</li>
                    <li class="marg_bottom_line li-bullet">Your comments should focus on the Vehicle context.</li>
                    <li class="marg_bottom_line li-bullet">Be expressive. Tell people about your experience in details.</li>
                </ul>
            </div>

            <div class="clear"></div>
            <p>
            <div class="rowElem">
                <div class="fleft mid_col">
                    <label><strong>Your Name:</strong> </label> 
                    <?= form_error('name', '<div class="error">', '</div>'); ?>
                    <?php
                    $n = '';
                    $e = '';
                    if ($this->session->userdata('mem_fname')) {
                        $n = $this->session->userdata('mem_fname') . ' ' . $this->session->userdata('mem_lname');
                        $e = $this->session->userdata('mem_email');
                    }
                    ?>

                    <?php if (!$n) { ?>
                        <input type="text" name="name" value="<?= set_value('name'); ?>"/>
                    <?php } else { ?>
                        <input type="text" name="name" readonly="readonly" value="<?= $n; ?>"/>
                    <?php } ?>

                </div>

                <div class="fleft mid_col">
                    <label><strong>Your Email </strong></label>
                    <span class="font_1"> (Will not display)</span>
                    <?= form_error('email', '<div class="error">', '</div>'); ?>
                    <div id="sale_car_model_div">
                        <?php if (!$e) { ?>
                            <input type="text" name="email" value="<?= set_value('email'); ?>"/>
                        <?php } else { ?>
                            <input type="text" name="email" readonly="readonly" value="<?= $e; ?>"/>
                        <?php } ?>
                    </div>
                </div>

            </div>
            <div class="clear"></div>

            <div  class="rowElem">
                <label><strong>Pros</strong></label>
                <span class="font_1"> (The things you like)</span>
                <?= form_error('pros', '<div class="error">', '</div>'); ?>
                <textarea id="pros" name="pros" cols="76" rows="2"><?= set_value('pros'); ?></textarea>
            </div>

            <div  class="rowElem">
                <label><strong>Cons</strong></label>
                <span class="font_1"> (The things you don't like)</span>
                <?= form_error('cons', '<div class="error">', '</div>'); ?>
                <textarea id="cons" name="cons" cols="76" rows="2"><?= set_value('cons'); ?></textarea>
            </div>

            <div  class="rowElem">
                <label><strong>Detailed Review</strong></label>
                <span class="font_1"> (Maximum 8000 characters (approx. 2000 words). Minimum 150 words.)</span>
                <?= form_error('review_detail', '<div class="error">', '</div>'); ?>
                <textarea id="review_detail" name="review_detail" cols="76" rows="10"><?= set_value('review_detail'); ?></textarea>
                <script type="text/javascript">
                    //<![CDATA[
                    CKEDITOR.replace( 'review_detail',
                    {
                        skin : 'v2',
                        enterMode : CKEDITOR.ENTER_DIV,
                        toolbar :
                            [
                            [ 'Bold', 'Italic', '-', 'NumberedList', 'BulletedList', '-', 'Link', 'Unlink' ],
                            [ 'UIColor' ]
                        ]

                    });
                    //]]>
                </script>

            </div>

            <div>
                <a onClick="document.getElementById('post_review').submit()" class="inline-block button_search color_1 bold"><span class="inline-block">Post Reviews</span> </a>
            </div>

        </div>
    </form>

</div> <!-- End of Box_2 -->




